package com.phiture.erp.produce.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

@Getter
@AllArgsConstructor
public enum MrpTaskIssueStatusEnum {
    NOT_YET_ISSUED(1, "未下达"),
    PARTIALLY_ISSUED(2, "部分下达"),
    ALL_ISSUED(3, "全部下达");

    private final Integer status;
    private final String desc;

    private static final Map<Integer, MrpTaskIssueStatusEnum> STATUS_MAP = new HashMap<>(4);

    static {
        for (MrpTaskIssueStatusEnum statusEnum : MrpTaskIssueStatusEnum.values()) {
            STATUS_MAP.put(statusEnum.getStatus(), statusEnum);
        }
    }

    public static MrpTaskIssueStatusEnum fromStatus(Integer status){
        return STATUS_MAP.get(status);
    }
}
